<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /**
     * 2022年4月28日10:33:38
     * js 7
     * this指向 
     * 补充学习箭头函数
     */
    var name = 'window'
    const obj = {
      name: 'obj',
      sayName: function () {
        console.log(this.name)
      },
    }
    obj.sayMyName = () => {
      console.log(this.name)
    }
    const fn1 = obj.sayName
    const fn2 = obj.sayMyName
    fn1()
    obj.sayName()
    fn2()
    obj.sayMyName()
  </script>
</body>

</html>
